<template>
    <div>
      <nav-header></nav-header>
      <div class="container">
        <div class="page-title-normal">
          <h2 class="page-title-h2"><span>支付详情</span></h2>
        </div>
        <!-- 进度条 -->
        <!-- process step -->
        <div class="check-step">
          <ul>
            <li class="cur"><span>确认</span> 地址</li>
            <li class="cur"><span>查看</span> 订单</li>
            <li class="cur"><span>结清</span> 账单</li>
            <li class="cur"><span>确认</span> 订单</li>
          </ul>
        </div>

        <div class="order-create">
          <div class="order-create-pic"><img src="/static/ok-2.png" alt=""></div>
          <div class="order-create-main">
            <h3>支付成功! <br>您的商品会尽快邮递到您身边!</h3>
            <p>
              <span>订单id：{{orderId}}</span>
              <span>总金额：{{orderTotal | currency('￥')}}</span>
            </p>
            <div class="order-create-btn-wrap">
              <div class="btn-l-wrap">
                <router-link class="btn btn--m" to="/cart">返回购物车列表</router-link>
              </div>
              <div class="btn-r-wrap">
                <router-link class="btn btn--m" to="/">返回商品列表</router-link>
              </div>
            </div>
          </div>
        </div>
      </div>
      <nav-footer></nav-footer>
    </div>
</template>
<script>
  import NavHeader from '@/components/NavHeader'
  import navFooter from '@/components/footer'
  import navBread from '@/components/bread'
  import axios from 'axios'
  import Modal from '@/components/Modal'
    export default{
        data(){
            return{
              orderId: '',
              orderTotal: 0
            }
        },
        mounted() {
          var orderId = this.$route.query.orderId;
          if (!orderId) {
            return;
          }
          axios.get('/users/orderDetail',{
            params: {
              orderId: orderId
            }
          }).then((response) => {
            let res = response.data;
            if (res.status == '0') {
              this.orderId = orderId;
              this.orderTotal = res.result.orderTotal;
            }
          })
        },
        components: {
          navFooter,
          navBread,
          NavHeader,
          Modal
        }
    }
</script>
